import React, { Component } from 'react'
import Search from './components/Search/Search'
import List from './components/List/List'
export default class App extends Component {
  state = {
    userList: [],
    isFirst: true, // 标识页面是否为第一次打开
    isLoading: false, // 标识是否正在加载数据
    err: '' // 存储请求相关的错误信息
  }
  // 更新 APP 状态的方法
  updateAppState = stateObj => {
    this.setState(stateObj)
  }
  render () {
    return (
      <div>
        <Search updateAppState={this.updateAppState} />
        <List {...this.state} />
      </div>
    )
  }
}
